Skip to content

Conversation

@brianaydemir
Copy link
Contributor

@brianaydemir brianaydemir commented Dec 28, 2025

This PR makes two improvements to our container images.

The primary improvement is to entrypoint.sh, which now scans /certs for certificates (*.crt files) and adds them to the container's trust store. During development and testing, this should help minimize, if not eliminate, the need to resort to TLSSkipVerify: true or similar, especially for those programs that might not be aware of Pelican's configuration (e.g., curl).

Note

There is hypothetically a backwards compatibility concern given that I chose to scan /certs based on where We™ currently seem to bind mount certificates into containers. That said, I would find it passing strange for a container to mount a certificate it doesn't trust but presumably expects the rest of the world to trust.

The secondary improvements are to the container image build process (the Dockerfile), which are intended to facilitate repeated image builds by improving layer caching and not building unnecessary binaries.

@brianaydemir brianaydemir added this to the v7.23 milestone Dec 28, 2025
@brianaydemir brianaydemir added enhancement New feature or request internal Internal code improvements, not user-facing container labels Dec 28, 2025
@brianaydemir brianaydemir linked an issue Dec 28, 2025 that may be closed by this pull request
@brianaydemir brianaydemir force-pushed the container-improvements branch from 8f37e40 to c50c8cf Compare December 29, 2025 14:27
@brianaydemir
Copy link
Contributor Author

For testing, I've been using something like the following framework:

Of special note is the ./certs/.init.sh script, which provides an example how to create and use a CA. (You'll probably want to modify environment.cfg to refer to your own container images.)

Once you've got the containers up and running, you can try things like:

# Check for errors in the entrypoint script.
$ docker logs pelican-director-1 2>&1 | less

# Check whether we need to skip certificate validation.
$ docker exec -it pelican-director-1 bash -il
[root@director pelican]# curl https://registry:8444/
<a href="/view/">Found</a>.

[root@director pelican]# curl https://origin-0:8444/
<a href="/view/">Found</a>.

[root@director pelican]# curl https://cache-0:8444/
<a href="/view/">Found</a>.

@brianaydemir brianaydemir force-pushed the container-improvements branch from c50c8cf to d771559 Compare December 30, 2025 13:52
'graphviz' is necessary for some of `go tool pprof`'s visualizations.

'psmisc' includes `killall`, which is useful for cleaning up after
accidental mass-invocations of some command, such as the file transfer
plugin.
@brianaydemir brianaydemir force-pushed the container-improvements branch from d771559 to 615d429 Compare December 30, 2025 19:09
Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look okay to me, and if the entrypoint updates help you I'm not opposed to them -- I'll note that I'm not sure the trick of adding /certs to anchor and updating the trust store helps most of the Pelican devs. I did a quick poll and we're all using the VSCode devcontainers extension, which doesn't go through the entrypoints defined here. At least in my case, I also rely on Pelican to generate a new CA on its first run whenever I need to restart my container, at which point it's too late to do something clever with entrypoints.

@brianaydemir
Copy link
Contributor Author

@jhiemstrawisc

I did a quick poll and we're all using the VSCode devcontainers extension, which doesn't go through the entrypoints defined here. At least in my case, I also rely on Pelican to generate a new CA on its first run whenever I need to restart my container, at which point it's too late to do something clever with entrypoints.

To quote Luke Skywalker, "Every word of what you just said was wrong."

Obviously, not literally so, but… I am aware of no production service that is expected to create its own certificate or CA on startup (or restart), and Pelican's released container images use these entrypoints, so the notion that there's a developer out there that doesn't go through these entrypoints is… What are they actually testing?

@brianaydemir brianaydemir merged commit bff74fc into PelicanPlatform:main Jan 9, 2026
28 of 31 checks passed
@brianaydemir brianaydemir deleted the container-improvements branch January 9, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

container enhancement New feature or request internal Internal code improvements, not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable containers to add CAs to the trust store on start up

2 participants